import request from '@/utils/request'

//课程模块
export default {
  //查询所有课程
  findAll(){
    return request({
      url: `/eduservice/course/findAll`,
      method: 'get'
    })
  },
  //添加课程
  add(courseInfo){
    return request({
      url: `/eduservice/course/add`,
      method: 'post',
      data: courseInfo
    })
  },
  //根据courseId查询courseInfo
  getCourseInfo(courseId){
    return request({
      url: `/eduservice/course/findById/${courseId}`,
      method: 'get'
    })
  },
  //更新课程信息
  update(courseInfo){
    return request({
      url: `/eduservice/course/update`,
      method: 'post',
      data: courseInfo
    })
  },
  //根据courseId查询CoursePublishVo
  findCoursePublishVo(courseId){
    return request({
      url: `/eduservice/course/findCoursePublishVoByCourseId/${courseId}`,
      method: 'get'
    })
  },
  //发布课程
  publish(courseId){
    return request({
      url: `/eduservice/course/publish/${courseId}`,
      method: 'get'
    })
  },
  //删除课程
  deleteById(id){
    return request({
      url: `/eduservice/course/deleteById/${id}`,
      method: 'get'
    })
  },
  //分页条件查询课程信息
  conditionAndPageFind(courseQuery,page,size){
    return request({
      url: `/eduservice/course/conditionAndPageFind/${page}/${size}`,
      method: 'post',
      data: courseQuery
    })
  }
}
